from rest_framework import serializers
from django.contrib.auth.models import Group


class UserGroupSerializer(serializers.ModelSerializer):
    class Meta:
        model = Group
        fields = ("id","name","permissions")
        # extra_kwargs = {
        #     "permissions":{"write_only":True}
        # }

#
# {
#         "counts": "用户组总数量",
#         "list": [
#             {
#                 "id": "组id",
#                 "name": "组名称",
#             },
#             ...
#         ],
#         "page": "当前页码",
#         "pages": "总页码",
#         "pagesize": "页容量"
#     }



 # [
 #        {
 #            "id": "权限类型id",
 #            "name": "权限类型名称"
 #        },
 #        ...
 #    ]